package com.zl.roomdesignserver.entity.design;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

/**
 * Created by zhangli on 2018/6/5 18:13.</br>
 */
@Entity
@Table(name = "material")
public class MaterialEntity implements Serializable {

    @Column(name = "type")
    private String type;

    @Column(name = "name")
    private String name;

    @Column(name = "deleted")
    private int deleted;

    @Column(name = "timestp")
    private long timeStamp;

    @Id
    @Column(name = "file_name")
    private String fileName;

    @Transient
    private List<MaterialEntity> list;

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public List<MaterialEntity> getList() {
        return list;
    }

    public void setList(List<MaterialEntity> list) {
        this.list = list;
    }

    public long getTimeStamp() {
        return timeStamp;
    }

    public void setTimeStamp(long timeStamp) {
        this.timeStamp = timeStamp;
    }

    public int getDeleted() {
        return deleted;
    }

    public void setDeleted(int deleted) {
        this.deleted = deleted;
    }

    @Override
    public int hashCode() {
        return type.hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        return obj instanceof MaterialEntity && type.equals(((MaterialEntity)obj).type);
    }
}
